package com.ly.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import javax.annotation.Resource;

/**
 *
 */
@RestController
@RequestMapping("consumer")
public class OrderController {

    public static final String PAYMENT_URL = "http://consul-provider-paymnet/consul/";

    @Resource
    private RestTemplate restTemplate;

    @GetMapping("/consul/getConsul")
    public String getConsul() {
        return restTemplate.getForObject(PAYMENT_URL+"getConsul",String.class);
    }

}
